<template>
  <div class="demo">
    <p>学校名称：{{ name }}</p>
    <p>学校地址：{{ address }}</p>
    <button @click="showName">点我显示学校名称</button>
  </div>
</template>

<script>
//组件交互的代码
//export default school分别暴露
export default {
  name: "School", //开发者工具最终呈现的名字为School
  data() {
    return {
      name: "北京大学",
      address: "北京",
    };
  },
  methods: {
    showName() {
      alert(this.name);
    },
  },
};
//统一暴露
// export { school };
// export default school //默认暴露
</script>

<style>
</style>